import 'package:boss/models/un_bound_commodity_list_data.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/page/commodity/bindingCommodity/provider/binding_commodity_provider.dart';
import 'package:boss/ui/widget/column_divier.dart';
import 'package:boss/ui/widget/loader/loader.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import 'bound_row.dart';
import 'un_bound_list.dart';
import 'un_bound_row.dart';

class BindingCommodityBrowser extends StatefulWidget {
  @override
  _BindingCommodityBrowserState createState() => _BindingCommodityBrowserState();
}

class _BindingCommodityBrowserState extends State<BindingCommodityBrowser> {
  @override
  Widget build(BuildContext context) {
    return Loader<UnBoundCommodityData>(
      loadTask: Provider.of<BindingCommodityProvider>(context, listen: false).initData,
      builder: (context) => DefaultTextStyle(
        style: TextStyleConstant().normal_1_28,
        child: ColumnDivier(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            BoundRow(),
            UnBoundRow(),
            UnBoundList(),
          ],
        ),
      ),
    );
  }
}
